ValidationResult
A result of any type T that is wrapped with an optional error message
Used to provide contextual error information "upstream" of where the error was encountered, which allows for better logging where upstream elements can collate error messages passed back to them into an organized and sensible error log.
This class has a private constructor to force the use of the pre-defined static instantiation methods
Author
fzzyhmstrs
Since
0.1.0
Parameters
result type, can be nullable
Types
Error context stored in a ValidationResult. This can represent an errored or non-errored state, can include multiple children contexts, and can include non-textual information (see ValidationResult.Errors.ACTION for example)
Functions
Adds another test, and potentially another error, to a Validation.
Reports errors in this validation to an error consumer.
Maps this validation to a new type using a mapping function
Inspects the error of the result, if any, for errors of a particular type
Supplies the error context stored within, if any
Maps this validation to a new type using a mapping function
Boolean check to determine if this result is holding a critical (exception-caused) error
Iterates over all ErrorEntry.Entry contained in this result
Provides an iterable containing any applicable ErrorEntry.Entry of the provided type
Log this result if it is errored.
Log this result if it is errored.
Maps this validation's stored value to a new type using a mapping function
reports error, if any, to a provided reporter (such as a logger)
reports error, if any, to a provided string list
Reports errors in this validation to an error consumer.
Performs the provided predicate test on this results error entry and any of its children. Generally returns true on the first success.
Performs the provided predicate test on this results error entry and any of its children if they are of the provided type. Generally returns true on the first success.
Creates a new ValidationResult of type T wrapping the new value with the error(if any) from the receiver ValidationResult (of any type, does not need to match T)
Writes an error log to console if this validation result is errored
Writes a warning log to console if this validation result is errored